<template>
  <div>
    <el-table :data="listStatus.list" v-if="this.listStatus.list.length > 0" max-height="400px">
      <el-table-column label width="40" align="center">
        <template slot-scope="scope">
          <i :class="[scope.row.status === 0 ? 'el-icon-success' : 'el-icon-error', 'statusIcon' + scope.row.status, 'statusIcon']"></i>
        </template>
      </el-table-column>
      <el-table-column label="修改项" min-width="200">
        <template slot-scope="scope">{{ scope.row.name }}</template>
      </el-table-column>
      <el-table-column label="结果">
        <template slot-scope="scope">
          <span :class="'statustext' + scope.row.status">{{ scope.row.result }}</span>
        </template>
      </el-table-column>
    </el-table>
    <!-- code 为1成功 0失败 -->
    <!-- {{!listStatus.tips}} -->
    <el-alert
      v-if="listStatus.code !== ''"
      :title="!listStatus.tips ? aletTips[listStatus.code] : listStatus.tips"
      :closable="false"
      :type="listStatus.code === 1 ? 'success' : 'error'"
      show-icon
    ></el-alert>
    <!-- :type="listStatus.code===1?success:error" -->
    <div slot="footer" class="dialog-footer">
      <!-- <el-button @click="dialogFormVisible = false">取 消</el-button> -->
      <el-button type="primary" class="btnSizeStyle" @click.stop="qdBtn">确 定</el-button>
    </div>
  </div>
</template>
<script>
export default {
  props: ['listStatus'],
  data() {
    return {
      aletTips: ['未同步到资产列表,请前往资产列表点击“同步主机信息”按钮。', '主机修改成功项，已同步到资产列表。'],
    }
  },
  created() {
    // console.log('-------', this.listStatus)
  },
  methods: {
    qdBtn() {
      this.$emit('child-event', false)
    },
  },
}
</script>
<style lang="scss" scoped>
.dialog-footer {
  padding: 10px;
  text-align: right;
}
.statusIcon {
  font-size: 16px !important;
}
.statusIcon0 {
  color: #67c23a;
}
.statusIcon1 {
  color: #f56c6c;
}
.statustext0 {
  color: #039d12;
}
.statustext1 {
  color: #f56c6c;
}
.el-alert {
  margin-top: 15px;
  padding: 15px 15px;
}
</style>
